package STUDENT.TRANDAODAIVI.OOPs.BaitapOOPEX2;
class Rectangle{
	double width=1;
	double height=1;
	static String color="white";
	
	public Rectangle(double width,double height){
		this.width=width;
		this.height=height;
	}
	
	public double getArea(Rectangle object){
		return width*height;
	}
	public double getPerimeter(Rectangle object){
		return (width+height)*2;
	}
	public void toString(Rectangle object){
		
		System.out.println("Mau      : "+color);
		System.out.println("Dien tich: "+Math.round(getArea(object)));
		System.out.println("Chu vi   : "+Math.round(getPerimeter(object)));
	}
}
public class BT4 {
public static void main(String[] args){
	Rectangle a=new Rectangle(4,40);
	Rectangle b=new Rectangle(3.5,35.9);
	a.color="red";
	System.out.println("Hinh chu nhat a co: ");
    a.toString(a);
    System.out.println("Hinh chu nhat b co: ");
    b.toString(b);
    
    
	
}
}
